QT += widgets dbus

TEMPLATE = lib
CONFIG += plugin link_pkgconfig c++11

LIBS += -lukcc

PKGCONFIG += gsettings-qt \
             gio-2.0 \
             gio-unix-2.0 \
             upower-glib \
             kysdk-qtwidgets

exists(/usr/include/kysdk/kysdk-system/libkysysinfo.h) {
    DEFINES += KY_SDK_SYSINFO
    PKGCONFIG += kysdk-sysinfo
}

TARGET = $$qtLibraryTarget(power)
target.path = $$[QT_INSTALL_LIBS]/ukui-control-center

isEmpty(PREFIX) {
    PREFIX = /usr
}

trans.files = translations/*
trans.path = /usr/share/ukui-power-manager/power-plugin/translations

CONFIG(release, debug|release) {
    !system($$PWD/translate_generation.sh): error("Failed to generate translation")
}


INSTALLS += target \
            trans

HEADERS += \
    power.h \
    powermacrodata.h

SOURCES += \
    power.cpp

TRANSLATIONS += \
    translations/zh_CN.ts \
    translations/bo_CN.ts \
    translations/en_US.ts
